﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter07.ViewModel
{
    using Microsoft.Win32;
    using Microsoft.VisualBasic.ApplicationServices;

    public class SingleInstanceApplicationWrapper : WindowsFormsApplicationBase
    {
        private App app;

        public SingleInstanceApplicationWrapper()
        {
            IsSingleInstance = true;
        }

        protected override bool OnStartup(StartupEventArgs eventArgs)
        {
            app = new App();
            app.Run();
            return false;
        }

        protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
        {
            base.OnStartupNextInstance(eventArgs);
            if (eventArgs.CommandLine.Count > 0)
            {

            }
        }
    }
}
